package com.finace.money.presenter;

import com.finace.money.data.bean.AnalyseListBean;
import com.finace.money.data.bean.DealRecordListBean;
import com.finace.money.net.rto_rxbuild.RxHttpReponseCompat;
import com.finace.money.net.rto_subscriber.ProgressSubcriber;
import com.finace.money.presenter.contract.MainNewsContract;

import javax.inject.Inject;

/**
 * Created by zhangpeng on 2018/1/27.
 */

public class MainNewsPresenter extends BasePresenter<MainNewsContract.IMainNewsModel,MainNewsContract.View>{
    
    @Inject
    public MainNewsPresenter(MainNewsContract.IMainNewsModel iMainNewsModel, MainNewsContract.View view) {
        super(iMainNewsModel, view);
    }

    public void getAnalyseList(String pagerSize, String pageNumber){

        mModel.getAnalyseList(pagerSize,pageNumber).compose(RxHttpReponseCompat.<AnalyseListBean>compatResult())
                .subscribe(new ProgressSubcriber<AnalyseListBean>(mContext,mView) {
                    @Override
                    public void onNext(AnalyseListBean analyseListBean) {
                        if(hasView()){
                            mView.getAnalyseListSucess(analyseListBean);
                        }
                    }
                });

    }
}
